coordinate conversion
Conversions between coordinate systems are provided by:
XgrConvertDisplayToGrid (grid, xDisp, yDisp, @xGrid, @yGrid)
XgrConvertDisplayToLocal (grid, xDisp, yDisp, @x, @y)
XgrConvertDisplayToScaled (grid, xDisp, yDisp, @x#, @y#)
XgrConvertDisplayToWindow (grid, xDisp, yDisp, @xWin, @yWin)
XgrConvertGridToDisplay (grid, xGrid, yGrid, @xDisp, @yDisp)
XgrConvertGridToLocal (grid, xGrid, yGrid, @x, @y)
XgrConvertGridToScaled (grid, xGrid, yGrid, @x#, @y#)
XgrConvertGridToWindow (grid, xGrid, yGrid, @xWin, @yWin)
XgrConvertLocalToDisplay (grid, x, y, @xDisp, @yDisp)
XgrConvertLocalToGrid (grid, x, y, @xGrid, @yGrid)
XgrConvertLocalToScaled (grid, x, y, @x#, @y#)
XgrConvertLocalToWindow (grid, x, y, @xWin, @yWin)
XgrConvertScaledToDisplay (grid, x#, y#, @xDisp, @yDisp)
XgrConvertScaledToGrid (grid, x#, y#, @xGrid, @yGrid)
XgrConvertScaledToLocal (grid, x#, y#, @x, @y)
XgrConvertScaledToWindow (grid, x#, y#, @xWin, @yWin)
grid location coordinates
The upper-left : lower-right corners of grids are provided by:
XgrGetGridBoxDisplay (grid, @x1Disp, @y1Disp, @x2Disp, @y2Disp)
XgrGetGridBoxGrid (grid, @x1Grid, @y1Grid, @x2Grid, @y2Grid)
XgrGetGridBoxLocal (grid, @x1, @y1, @x2, @y2)
XgrGetGridBoxScaled (grid, @x1#, @y1#, @x2#, @y2#)
XgrGetGridBoxWindow (grid, @x1Win, @y1Win, @x2Win, @y2Win)
drawing coordinates
Graphics is drawn in any combination of three coordinate systems:
Local Coordinates - XgrDrawPoint (grid, color, x, y)
Grid Coordinates - XgrDrawPointGrid (grid, color, xGrid, yGrid)
Scaled Coordinates - XgrDrawPointScaled (grid, color, x#, y#)
GraphicsDesigner includes a complete set of drawing functions for local coordinates, grid
coordinates, and scaled coordinates.
For example, a line is drawn from the upper-left to lower-right corner of the following
grid by all three of the line drawing functions:
XgrCreateWindow ( @win, winType, 300, 300, 200, 200, &winFunc(), "" )
XgrCreateGrid ( @grid, gridType, 10, 10, 100, 100, win, 0, gfunc )
XgrSetGridBoxGrid ( grid, -49, 50, 50, -49 )
XgrSetGridBoxScaled ( grid, -320, +85, +14495, -40 )
XgrDrawLine ( grid, $$Red, 0, 0, 99, 99 )
XgrDrawLineGrid ( grid, $$Green, -49, 50, 50, -49 )
XgrDrawLineScaled ( grid, $$Blue, -320, +85, +14495, -40 )